#!/usr/bin/env bash

curl -sSL https://get.daocloud.io/docker | sh

docker --version

curl -L https://get.daocloud.io/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose


docker-compose --version

sudo usermod -aG docker $USER

# Composer 报错 proc_open(): fork failed - Cannot allocate memory
# 这里设置2G的swap
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=4096 \
&& sudo /sbin/mkswap /var/swap.1 \
&& sudo /sbin/swapon /var/swap.1
